$(document).ready(function () {

    $("#header").load("Nav.html #Nav", function () {
        element.init();
        $("#Index").addClass("layui-this");
    });

});
table.on('tool(test)', function (obj) {
    var data = obj.data; //获得当前行数据
    var layEvent = obj.event; //获得 lay-event 对应的值（也可以是表头的 event 参数对应的值）
    console.log(layEvent);
    if (layEvent === 'TipsRepay') {
        Tips_Repay(data.card_id);
    }
});

function Tips_Repay(card_id) {
    layer.confirm('请确认是否标记还款', {
        btn: ['是', '否'] //按钮
    }, function () {
        $.post("/ShenBlue/imp/CreditCardTips", {mode: 1, card_id: card_id}, function (data) {
            const error = data["error"];
            const msg = data["msg"];
            if (error !== undefined) {
                layer.msg(error, {icon: 5});
                setTimeout("location.reload()", 1500);
                return;
            }
            layer.msg(msg, {icon: 1});
            setTimeout("location.reload()", 1500);
            return;
        });
    });
}